<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<%!
	public String getVal(String strVal,String def)
	{
		return (strVal==null?def:strVal);
	}
	
	public String replaceString(String sStr,String oldStr,String newStr)
	{
		sStr=(sStr==null?"":sStr);
		String strVar=sStr;
		String tmpStr="";
		String finalStr="";
		int stpos=0,endpos=0,strLen=0;
		while (true)
		{
		strLen=strVar.length();
		stpos=0;
		endpos=strVar.indexOf(oldStr,stpos);
		if (endpos==-1)
		break;
		tmpStr=strVar.substring(stpos,endpos);
		tmpStr=tmpStr.concat(newStr);
		strVar=strVar.substring(endpos+oldStr.length()>sStr.length()?endpos:endpos+oldStr.length(),strLen);
		finalStr=finalStr.concat(tmpStr);
		stpos=endpos;
		}
		finalStr=finalStr.concat(strVar);
		return finalStr;
	}
%>
</body>
</html>